#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
	int n, i;
	int sum = 0;
	int t = 1;
	printf("Please input:n= ");
	scanf("%d", &n);
	for (i = 1; i <= n; i++)
	{
		t = t * i;
		sum = sum + t;
	}
	printf("1!+2!+...+n!=%d",sum);
	return 0;
}